from flask import Blueprint,request,redirect,make_response,Response
from application.models.model import User
from cache import my_cache
from swaager_init import siwa,BaseModel
from db_init import db
from sqlalchemy.exc import IntegrityError
from tools.data_tools import orm2dict
from flask_login import login_user,login_required,current_user
from captcha.image import ImageCaptcha
import re,redis,random,string
from cache import my_cache
from datetime import datetime
import arrow

back = siwa.blueprint("userblue", __name__)

@back.route("/reg",methods=['post'],body=BaseModel)
def vip_reload():
    day = arrow.now().int_timestamp
    User.query.filter(User.vip_end_t.__lt__(day)).update({'vip':0})
    db.session.commit()
    return {'code':204}




